package yanivosher.aiproject;

import java.util.ArrayList;

public abstract class Agent {

	public int explorationCost = 0;
	public int score = 0;
	Vertex currentVertex;
	Vertex destinationVertex;
	public ArrayList<Step> stepListForPrint;

	public Agent(Vertex currentVertex, Vertex destinationVertex) {
		this.currentVertex = currentVertex;
		this.destinationVertex = destinationVertex;
		this.stepListForPrint = new ArrayList<Step>();

	}
	
	public abstract boolean idDone();

	public abstract Step makeAmove(Graph curr);
	
	public void raiseScore(int cost) {
		score += cost;
	}

	protected ArrayList<Vertex> getAvailableEdges()
	{
		ArrayList<Vertex> retList = new ArrayList<Vertex>();
		for (Edge edge : Environment.getInstance().graph.getEdges()) {
			if(edge.getSource().equals(this.currentVertex))
				retList.add(edge.getDestination());
			if(edge.getDestination().equals(this.currentVertex))
				retList.add(edge.getSource());
		}
		return retList;
	}
}
